\hypertarget{rotary__encoder_8c}{
\section{front\_\-panel/rotary\_\-encoder.c File Reference}
\label{rotary__encoder_8c}\index{front\_\-panel/rotary\_\-encoder.c@{front\_\-panel/rotary\_\-encoder.c}}
}
Rotary encoder functions.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include \char`\"{}board.h\char`\"{}}\par
{\tt \#include \char`\"{}rotary\_\-encoder.h\char`\"{}}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned char \hyperlink{rotary__encoder_8c_9ff79e94d2e64c8a9c22fa57723d93fe}{poll\_\-encoder\_\-state} (void)
\begin{CompactList}\small\item\em Poll the rotary encoder pin states. \item\end{CompactList}\item 
int \hyperlink{rotary__encoder_8c_d60cbce0f59801111441698f587798e2}{rotary\_\-encoder\_\-poll} (void)
\begin{CompactList}\small\item\em Poll the rotary encoder. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{rotary__encoder_8c_c9783984e8d7edc191708704ce35a939}{
unsigned char \hyperlink{rotary__encoder_8c_c9783984e8d7edc191708704ce35a939}{encoder\_\-last\_\-state} = 0}
\label{rotary__encoder_8c_c9783984e8d7edc191708704ce35a939}

\begin{CompactList}\small\item\em The last state of the encoder. \item\end{CompactList}\item 
\hypertarget{rotary__encoder_8c_54cfa0201f3c9a527275b48e366c5047}{
unsigned char \hyperlink{rotary__encoder_8c_54cfa0201f3c9a527275b48e366c5047}{encoder\_\-current\_\-state} = 0}
\label{rotary__encoder_8c_54cfa0201f3c9a527275b48e366c5047}

\begin{CompactList}\small\item\em The current state of the encoder. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Rotary encoder functions. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "front_panel/rotary_encoder.c" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{rotary__encoder_8c-source}{rotary\_\-encoder.c}.

\subsection{Function Documentation}
\hypertarget{rotary__encoder_8c_9ff79e94d2e64c8a9c22fa57723d93fe}{
\index{rotary\_\-encoder.c@{rotary\_\-encoder.c}!poll\_\-encoder\_\-state@{poll\_\-encoder\_\-state}}
\index{poll\_\-encoder\_\-state@{poll\_\-encoder\_\-state}!rotary_encoder.c@{rotary\_\-encoder.c}}
\subsubsection[{poll\_\-encoder\_\-state}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char poll\_\-encoder\_\-state (void)}}
\label{rotary__encoder_8c_9ff79e94d2e64c8a9c22fa57723d93fe}


Poll the rotary encoder pin states. 

\begin{Desc}
\item[Returns:]The state of the rotary encoder pins \end{Desc}


Definition at line 38 of file rotary\_\-encoder.c.

References PULSE\_\-SENSOR\_\-BIT1, and PULSE\_\-SENSOR\_\-BIT2.

Referenced by rotary\_\-encoder\_\-poll().\hypertarget{rotary__encoder_8c_d60cbce0f59801111441698f587798e2}{
\index{rotary\_\-encoder.c@{rotary\_\-encoder.c}!rotary\_\-encoder\_\-poll@{rotary\_\-encoder\_\-poll}}
\index{rotary\_\-encoder\_\-poll@{rotary\_\-encoder\_\-poll}!rotary_encoder.c@{rotary\_\-encoder.c}}
\subsubsection[{rotary\_\-encoder\_\-poll}]{\setlength{\rightskip}{0pt plus 5cm}int rotary\_\-encoder\_\-poll (void)}}
\label{rotary__encoder_8c_d60cbce0f59801111441698f587798e2}


Poll the rotary encoder. 

\begin{Desc}
\item[Returns:]Returns 0 if nothing happened, -1 if rotary CCW and 1 if CW \end{Desc}


Definition at line 44 of file rotary\_\-encoder.c.

References encoder\_\-current\_\-state, encoder\_\-last\_\-state, and poll\_\-encoder\_\-state().

Referenced by main().